import request from '@/utils/request'
export function getSmsCode(data) {
  return request({
    url: '/sendmscode',
    method: 'post',
    data: data
  })
}
// 登录方法
export function login(phoneNumber, sendType, code, uuid,smsCode) {
  const data = {
    phoneNumber,
    sendType,
    code,
    uuid,
    smsCode
  }
  return request({
    url: '/business/registeredUser/userRegistration',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}

//注册方法
export function zlogin(phoneNumber, sendType, code, uuid,smsCode,registeredType,openId) {
  const data = {
    phoneNumber,
    sendType,
    code,
    uuid,
    smsCode,
    registeredType,
    openId
  }
  return request({
    url: '/business/registeredUser/userRegistration',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}
//帮登录
export function banglogin(phoneNumber, sendType, code, uuid,smsCode,registeredType,openId) {
  const data = {
    phoneNumber,
    sendType,
    code,
    uuid,
    smsCode,
    registeredType,
    openId
  }
  return request({
    url: '/business/registeredUser/userRegistration',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}
export function weiLogin(phoneNumber, sendType, code, uuid,smsCode,openId) {
  const data = {
    phoneNumber,
    sendType,
    code,
    uuid,
    smsCode,
    openId
  }
  return request({
    url: '/wechatLogin',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}


// 登录方法 张启航
export function loginZhang(username, password, code, uuid) {
  const data = {
    username,
    password,
    code,
    uuid
  }
  return request({
    url: '/login',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}



// 注册方法
export function register(data) {
  return request({
    url: '/register',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}

// 获取用户详细信息
export function getInfo() {
  return request({
    url: '/getInfo',
    method: 'get'
  })
}

// 退出方法
export function logout() {
  return request({
    url: '/logout',
    method: 'post'
  })
}

// 获取验证码
export function getCodeImg() {
  return request({
    url: '/captchaImage',
    headers: {
      isToken: false
    },
    method: 'get',
    timeout: 20000
  })
}
//获取手机验证码

export function getcode(data) {
  return request({
    url: '/sendSmsCode',
    method: 'post',
    data: data
  })
}

export function loginnn(data) {
  return request({
    url: '/business/registeredUser/userRegistration',
    method: 'post',
    data: data
  })
}
//提交注册
export function registernew(data) {
  return request({
    url: '/business/registeredUser/userRegistration',
    method: 'post',
    data: data
  })
}
//获取微信吗

export function getweima() {
  return request({
    url: '/openplatform/getWechatLoginUrl',
    method: 'get'
  })
}
//
export function ceshiwei(data) {
  return request({
    url: '/wechatLogin',
    method: 'post',
    data: data
  })
}

